Skip to content

Fix sonarqube findings#552

Merged
jdw-creare merged 15 commits into
developfrom
feature/sq_findings
May 24, 2026
Merged

Fix sonarqube findings#552
jdw-creare merged 15 commits into
developfrom
feature/sq_findings

Conversation

@jdw-creare
Copy link
Copy Markdown
Collaborator

@jdw-creare jdw-creare commented May 11, 2026

The most significant change here is to switch the example dockerfile from Conda to vanilla python.

This PR also fixes three kinds of findings:

  • Commented-out code
  • Branches in if statements that were only pass
  • Variable assignment where the value is never subsequently referenced

@jdw-creare jdw-creare marked this pull request as ready for review May 13, 2026 17:27
Comment thread Dockerfile Fixed
Comment thread Dockerfile Fixed
Comment thread Dockerfile Fixed
Comment thread Dockerfile Fixed
@jdw-creare jdw-creare force-pushed the feature/sq_findings branch from 12335c8 to 1452ed1 Compare May 22, 2026 13:08
@sonarqubecloud
Copy link
Copy Markdown

@jdw-creare jdw-creare requested a review from mpu-creare May 22, 2026 15:04
Copy link
Copy Markdown
Contributor

@mpu-creare mpu-creare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few ranting comments, please proceed with the merge.

self._is_uniform = None

else:
elif self.coordinates.size != 0:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally find the if - pass more readable in this case... but oh well.

c = StackedCoordinates(c)
else:
c = ArrayCoordinates1d(c)
if not isinstance(c, BaseCoordinates):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting... in this case disallowing 'pass' creates an extra nest -- interesting.

def copy(self):
return PolarCoordinates(self.center, self.radius, self.theta, dims=self.dims)

# TODO return PolarCoordinates when possible
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally dislike getting rid of TODOs -- this is probably a great hint for some feature we didn't have time to implement but thought about when this was written... I suppose it's old enough that it no longer serves as a hint. Don't mind me, I'm just ranting today.

Comment thread podpac/__init__.py
if exist_ok:
pass
else:
if not exist_ok:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's an instance I wholeheartedly agree with!

Comment thread Dockerfile
wget && \
apt-get clean
COPY . /opt/podpac
WORKDIR /opt/podpac
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks the old image gets podpac from PYPI, whereas the new version installs it from the local repository. Not sure I really care, just noting the difference.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! I should've called that out in a commit message or something. I wanted to make sure it built with the very latest code. Of course, now it comes with the prerequisite that you build the dockerfile from within a full checkout of the repo, whereas before you could just build the dockerfile separately if you wanted to.

@jdw-creare jdw-creare merged commit c81561a into develop May 24, 2026
6 checks passed
@jdw-creare jdw-creare deleted the feature/sq_findings branch May 24, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants